//
//  WBTestViewController.swift
//  WJ微博
//
//  Created by 王杰 on 2017/1/18.
//  Copyright © 2017年 WangJie. All rights reserved.
//

import UIKit

class WBTestViewController: WBBaseViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()

        title = "第\(navigationController?.childViewControllers.count ?? 0)个"
    }
    
    // MARK: - 下一个
    func showNext() {
        
//        print(#function)
        
        let vc = WBTestViewController()
        navigationController?.pushViewController(vc, animated: true)
    }
    
}

extension WBTestViewController {

    override func setupTableView() {
   
        super.setupTableView()
        
        // 这中写法，按钮按下不会高亮
        // 设置右导航按钮
//        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", style: .plain, target: self, action: #selector(showNext))
        
//        let btn : UIButton = UIButton.cz_textButton("下一个", fontSize: 16.0, normalColor: UIColor.black, highlightedColor: UIColor.orange)
//        btn.addTarget(self, action: #selector(showNext), for: .touchUpInside)
//        navigationItem.rightBarButtonItem = UIBarButtonItem(customView: btn)
        // 简单写法
//        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", target: self, action: #selector(showNext))
        navItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", target: self, action: #selector(showNext))

    }
}

